/*
 * Skybox.h
 *
 *  Created on: 16/06/2013
 *      Author: david
 */

#ifndef SKYBOX_H_
#define SKYBOX_H_

#ifdef MacOSX
#include "GLee.h"
#include <GLUT/glut.h>
#else
#include "GLee.h"
#include <GL/glut.h>
#endif

#include <iostream>
#include "shader.h"
#include "tgaimage.h"
#include "matrix4f.h"
#include "GLError.h"


class Skybox {
public:
	Skybox(std::string topImage, std::string bottomImage, std::string leftImage, std::string rightImage, std::string farImage, std::string nearImage, Shader* program);
	~Skybox();
	void render();
	void configTexture();
	void setVBO();
	void setCube();

	Shader *program;
	unsigned int vaoHandle[6];
	Matrix4f matrix;

	std::string skyFileName;
	float scaleX;
	float scaleY;
	float scaleZ;
	TgaImage *top;
	TgaImage *far;
	TgaImage *bottom;
	TgaImage *near;
	TgaImage *left;
	TgaImage *right;
	GLuint *texID;

	float *topVert, *topTexCoord;
	float *farVert, *farTexCoord;
	float *bottomVert, *bottomTexCoord;
	float *nearVert, *nearTexCoord;
	float *leftVert, *leftTexCoord;
	float *rightVert, *rightTexCoord;

	int modelviewUniformHandle;

};

#endif /* SKYBOX_H_ */
